package com.globallogic.capacitaciones.hibernate.domain;

import java.util.Date;

import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "custom_shipment")
public class Shipment extends PersistentObject {
	
	private int inspectionPeriodDays;
	@Enumerated
	private ShipmenState state;
	private Date created;
	
	@ManyToOne
	private User seller;
	
	@Embedded
	private Address delivery;
	
	@ManyToOne
	private User buyer;
	
	@ManyToOne
	private Item item;
	
	
	public Shipment() {
		super();
	}

	public Shipment(int inspectionPeriodDays, ShipmenState state, Date created) {
		super();
		this.inspectionPeriodDays = inspectionPeriodDays;
		this.state = state;
		this.created = created;
	}

	public int getInspectionPeriodDays() {
		return inspectionPeriodDays;
	}

	public void setInspectionPeriodDays(int inspectionPeriodDays) {
		this.inspectionPeriodDays = inspectionPeriodDays;
	}

	public ShipmenState getState() {
		return state;
	}

	public void setState(ShipmenState state) {
		this.state = state;
	}

	public Date getCreated() {
		return created;
	}

	public void setCreated(Date created) {
		this.created = created;
	}

	public User getSeller() {
		return seller;
	}

	public void setSeller(User seller) {
		this.seller = seller;
	}

	public User getBuyer() {
		return buyer;
	}

	public void setBuyer(User buyer) {
		this.buyer = buyer;
	}


	public Item getItem() {
		return item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	public Address getDelivery() {
		return delivery;
	}

	public void setDelivery(Address delivery) {
		this.delivery = delivery;
	}
	
}
